package com.caojing.haolemai.ui.category.categorydclickactivity;

import com.caojing.haolemai.bean.categoryclickbean.CategoryClickBean;
import com.caojing.haolemai.httputils.HttpUtils;

import java.util.HashMap;

/**
 * Created by My on 2016/10/19.
 */
public class CategoryClickPresenter implements CategoryClickContract.Presenter{

    private CategoryClickContract.View view;
    private CategoryClickContract.Model model;

    CategoryClickPresenter(CategoryClickContract.View view){
            this.view=view;
            this.model=new CategoryClicjkModel();
    }

    @Override
    public void initCategoryClickData(HashMap<String, String> params) {
        model.getSuccessCategoryClickData(params, new HttpUtils.HttpCallBack<CategoryClickBean>() {
            @Override
            public void onSucess(CategoryClickBean categoryClickBean) {
                view.onSuccessCategoryClick(categoryClickBean);
            }

            @Override
            public void onFail() {
                view.onFailCategoryClick("点击网络加载失败");
            }
        });
    }
}
